The potting compound protects the substrate in the housing against environmental influences. The potting compound could also mechanically fix the printed circuit board in the housing.
In this case, the substrate can be completely surrounded by the potting compound.